import moduleRegist from '@/utils/moduleRegist';
import { module as PaymentModule } from './Module/paymentDifferenceMoudle';
import { module as SettlementModule } from './Module/settlementDifferenceMoudle';
import { module as AccountModule } from './Module/configAccountModule';
import { module as ContractModule } from './Module/configContractModule';

const Layout = resolve => { require(['./Layout'], resolve); };
const ConfigDifference = resolve => { require(['./ConfigDifference'], resolve); };
const ConfigAccount = resolve => { require(['./ConfigAccount'], resolve); };
const ConfigContract = resolve => { require(['./ConfigContract'], resolve); };
const ContractInfoFrom = resolve => { require(['./ContractInfoFrom'], resolve); };

/* eslint-disable */
export default [
    /** 配置管理路由 */
    {
        path: 'configCenter',
        redirect: 'configCenter/configDifference',
        component: Layout,
        meta: {
            title: '配置中心',
            name: '配置中心',
            permission: 'trade:common:config',
            componentName: 'ConfigpayerLayout',
            keepAlive: true,
            icon: '',
            show: false
        },
        beforeEnter: (to, from, next) => {
            moduleRegist(PaymentModule);
            moduleRegist(SettlementModule);
            moduleRegist(AccountModule);
            moduleRegist(ContractModule);
            next();
        },
        children: [{
                path: 'configDifference',
                component: ConfigDifference,
                meta: {
                    title: '差异原因配置',
                    name: '差异原因配置',
                    breadcrumb: '差异原因配置',
                    permission: 'trade:common:config:diff',
                    keepAlive: true,
                    componentName: 'ConfigpayerListView',
                    icon: ''
                }
            },
            {
                path: 'configAccount',
                component: ConfigAccount,
                meta: {
                    title: '对账参数配置',
                    name: '对账参数配置',
                    breadcrumb: '对账参数配置',
                    permission: 'trade:common:config:settleArgs',
                    keepAlive: true,
                    componentName: 'ConfigpayerListView',
                    icon: ''
                }
            },
            {
                path: 'configContract',
                component: ConfigContract,
                meta: {
                    title: '商户合同管理',
                    name: '商户合同管理',
                    breadcrumb: '商户合同管理',
                    permission: 'trade:common:config:contract',
                    keepAlive: true,
                    componentName: 'ConfigpayerListView',
                    icon: ''
                }
            },
            {
                path: 'contractInfoFrom',
                component: ContractInfoFrom,
                meta: {
                    title: '商户合同信息详情',
                    name: '商户合同信息详情',
                    breadcrumb: '商户合同信息详情',
                    permission: 'trade:common:config:contract',
                    keepAlive: true,
                    componentName: 'ConfigpayerListView',
                    show: false,
                    icon: ''
                }
            }
        ]
    }
];
